/**
 * Created by asus on 2017/4/18.
 */
(function(){
   function  Request(){
       console.log("实例化");
    }
    Request.prototype={
        init:function(opts){
            this.method=opts.method?opts.method:"POST"; //设置默认发送方法
            this.data=opts.data?opts.data:{};  //设置发送的数据
            this.url=opts.url;  //发送地址
            console.log("method:"+this.method);

            this.start=opts.start;
           /* for(var i in opts){
                console.log(i+"===>"+opts[i]);
            }*/
            this.begin();
        },
        begin:function(){//请求开始
            var _this=this;
            _this.start.call(this,"请求开始");
        },
        error:function(){ //请求中

        },
        end:function(){  //请求结束

        }

    }

    window.mRequest=new Request;

})();